/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import DAO.*;
import DTO.*;
import java.awt.Desktop;
import java.io.File;
//import java.util.List;

import java.util.List;
import java.util.ArrayList;
//import java.util.Date;
//import java.util.regex.*;

import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

//import java.awt.Graphics;
//import java.awt.Graphics2D;
//import java.awt.print.PageFormat;
//import java.awt.print.Printable;
//import java.awt.print.PrinterException;
//import java.awt.print.PrinterJob;



//import java.awt.event.*;
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileNotFoundException;
//import java.io.FileReader;
import java.io.IOException;
import java.text.SimpleDateFormat;

//import java.sql.*;
//import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;

import java.util.logging.Level;
import java.util.logging.Logger;
////import javax.swing.DefaultComboBoxModel;
//import javax.swing.JDialog;
//import javax.swing.JFileChooser;
import javax.swing.JFrame;
//import javax.swing.JTable.PrintMode;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.swing.JRViewer;

/**
 *
 * @author Luis Olave 10
 */
public class AprobacionGarantiaAutomotriz extends javax.swing.JFrame{

    usuarioDTO user;
    garantiasDAO reg = new garantiasDAO();
    garantiaAutomotrizDTO aproGaraAuto = new garantiaAutomotrizDTO();

    /**
     * Creates new form AprobacionGarantiaAutomotriz
     */
    public AprobacionGarantiaAutomotriz(usuarioDTO user) {
        this.user = user;
        initComponents();
        cargarItemsComboBoxEstadoGarantia();
        pnlIngreseRutGarante.setVisible(false);
        pnlIngreseRutGarante1.setVisible(false);
        this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    }

    private void cargarItemsComboBoxEstadoGarantia() {
        List<estadoGarantiaDTO> ListaGarantia = CCEstadoGarantia.listarItemEstado();
        if (ListaGarantia != null) {
            int size = ListaGarantia.size();
            for (int i = 0; i < size; i++) {
                this.cmbEstadoAprobAuto.addItem(ListaGarantia.get(i));
            }
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        pnlDatosPersoGara = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        txtNombreAprobAuto = new javax.swing.JTextField();
        txtApellMatAprobAuto = new javax.swing.JTextField();
        txtApellPatAprobAuto = new javax.swing.JTextField();
        txtRutGarAprobAuto = new javax.swing.JTextField();
        btnMenuAprobAuto = new javax.swing.JButton();
        pnlIngreseRutGarante = new javax.swing.JPanel();
        jLabel30 = new javax.swing.JLabel();
        txtFolioAprobGtiaAuto = new javax.swing.JTextField();
        btnBuscarPorFolio = new javax.swing.JButton();
        pnlIngreseRutGarante1 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        txtPatenteAprobGtiaAuto = new javax.swing.JTextField();
        btnBuscarPorPatente = new javax.swing.JButton();
        chkFolioAprobGtiaAuto = new javax.swing.JCheckBox();
        chkBuscarPatenteAprobGtiaAuto = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        pnlCreacionGaraAuto = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        lblArchivo = new javax.swing.JLabel();
        btnExaminarAprobGtiaAuto = new javax.swing.JButton();
        jPanel12 = new javax.swing.JPanel();
        lblSucursal = new javax.swing.JLabel();
        lblDireccion = new javax.swing.JLabel();
        lblMarca = new javax.swing.JLabel();
        lblPatente = new javax.swing.JLabel();
        lblNumChasis = new javax.swing.JLabel();
        FechCreacion = new javax.swing.JLabel();
        FechUltDebito = new javax.swing.JLabel();
        txtDireccionAprobAuto = new javax.swing.JTextField();
        txtNumChasisAprobAuto = new javax.swing.JTextField();
        txtPatenteAprobAuto = new javax.swing.JTextField();
        lblFechModifica = new javax.swing.JLabel();
        lblFechUltTasacion = new javax.swing.JLabel();
        lblNumMotor = new javax.swing.JLabel();
        txtNumMotorAprobGtiaAuto = new javax.swing.JTextField();
        txtAnoAprobAuto = new javax.swing.JTextField();
        lblAño = new javax.swing.JLabel();
        lblMoneda = new javax.swing.JLabel();
        txtSucAprobGtiaAuto = new javax.swing.JTextField();
        txtMarcaAprobAuto = new javax.swing.JTextField();
        txtFechCreaAprobAuto = new javax.swing.JTextField();
        txtFechUltAprobAuto = new javax.swing.JTextField();
        txtMonedaAprobAuto = new javax.swing.JTextField();
        txtFechUltTasacAprobAuto = new javax.swing.JTextField();
        txtFechModificaAprobAuto = new javax.swing.JTextField();
        jPanel13 = new javax.swing.JPanel();
        lblTipoGarantia = new javax.swing.JLabel();
        lblModelo = new javax.swing.JLabel();
        lblNumRegPrenda = new javax.swing.JLabel();
        lblFechExtincion = new javax.swing.JLabel();
        lblFechUltRevaluo = new javax.swing.JLabel();
        FechUltCredito = new javax.swing.JLabel();
        txtNumRegPrendaAprobAuto = new javax.swing.JTextField();
        txtTipoGtiaAprobAuto = new javax.swing.JTextField();
        txtModeloAprobAuto = new javax.swing.JTextField();
        txtFechExtAprobGtiaAuto = new javax.swing.JTextField();
        txtFechUltRevAprobAuto = new javax.swing.JTextField();
        txtFechUltCredAprobAuto = new javax.swing.JTextField();
        FechUltCredito1 = new javax.swing.JLabel();
        txtMontoInicialAutomotriz = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        pnlDescripGarantia = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        txtDescripcionAprobAuto = new javax.swing.JTextArea();
        lblDescripcion = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jPanel11 = new javax.swing.JPanel();
        btnMenuPAprobAuto = new javax.swing.JButton();
        btnAceptar = new javax.swing.JButton();
        pnlEstadoGarantia1 = new javax.swing.JPanel();
        lblEstrado1 = new javax.swing.JLabel();
        cmbEstadoAprobAuto = new javax.swing.JComboBox();
        pnlDescripGarantia2 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        txtDescripcionEstadoGtia = new javax.swing.JTextArea();
        lblDescripcion2 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        txtBuscarPatenteImprimir = new javax.swing.JTextField();
        btnBuscarPatenteImprimir = new javax.swing.JButton();
        btnImprimirAutomotriz = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbSalidarAutomotrizImprimir = new javax.swing.JTable();
        btnMenuPrincipalAutoMotriz = new javax.swing.JButton();
        btnExpAprobGtiaAuto = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("APROBACIÓN GARANTÍA AUTOMOTRIZ");
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
        jLabel1.setText("APROBACIÓN GARANTÍA AUTOMOTRIZ");

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGE/logo.JPG"))); // NOI18N

        jTabbedPane1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N

        pnlDatosPersoGara.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DATOS PERSONALES GARANTE", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jLabel36.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel36.setText("RUT");

        jLabel37.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel37.setText("APELLIDO PATERNO");

        jLabel39.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel39.setText("APELLIDO MATERNO");

        jLabel40.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel40.setText("NOMBRE");

        txtNombreAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtNombreAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtNombreAprobAuto.setEnabled(false);

        txtApellMatAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtApellMatAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtApellMatAprobAuto.setEnabled(false);

        txtApellPatAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtApellPatAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtApellPatAprobAuto.setEnabled(false);

        txtRutGarAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtRutGarAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtRutGarAprobAuto.setEnabled(false);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel37)
                    .addComponent(jLabel36))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtRutGarAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellPatAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel39)
                    .addComponent(jLabel40))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNombreAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellMatAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(196, 196, 196))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel36)
                        .addComponent(txtRutGarAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel40)
                        .addComponent(txtNombreAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(txtApellPatAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39)
                    .addComponent(txtApellMatAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlDatosPersoGaraLayout = new javax.swing.GroupLayout(pnlDatosPersoGara);
        pnlDatosPersoGara.setLayout(pnlDatosPersoGaraLayout);
        pnlDatosPersoGaraLayout.setHorizontalGroup(
            pnlDatosPersoGaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDatosPersoGaraLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlDatosPersoGaraLayout.setVerticalGroup(
            pnlDatosPersoGaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDatosPersoGaraLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        btnMenuAprobAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnMenuAprobAuto.setText("<< MENÚ PRINCIPAL");
        btnMenuAprobAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMenuAprobAutoActionPerformed(evt);
            }
        });

        pnlIngreseRutGarante.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE N° FOLIO", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jLabel30.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel30.setText("N° FOLIO");

        txtFolioAprobGtiaAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtFolioAprobGtiaAutoActionPerformed(evt);
            }
        });

        btnBuscarPorFolio.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarPorFolio.setText("BUSCAR");
        btnBuscarPorFolio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarPorFolioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlIngreseRutGaranteLayout = new javax.swing.GroupLayout(pnlIngreseRutGarante);
        pnlIngreseRutGarante.setLayout(pnlIngreseRutGaranteLayout);
        pnlIngreseRutGaranteLayout.setHorizontalGroup(
            pnlIngreseRutGaranteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlIngreseRutGaranteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel30)
                .addGap(18, 18, 18)
                .addGroup(pnlIngreseRutGaranteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtFolioAprobGtiaAuto)
                    .addComponent(btnBuscarPorFolio, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        pnlIngreseRutGaranteLayout.setVerticalGroup(
            pnlIngreseRutGaranteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlIngreseRutGaranteLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlIngreseRutGaranteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(txtFolioAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscarPorFolio)
                .addContainerGap())
        );

        pnlIngreseRutGarante1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE PATENTE", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jLabel31.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel31.setText("PATENTE");

        btnBuscarPorPatente.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarPorPatente.setText("BUSCAR");
        btnBuscarPorPatente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarPorPatenteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlIngreseRutGarante1Layout = new javax.swing.GroupLayout(pnlIngreseRutGarante1);
        pnlIngreseRutGarante1.setLayout(pnlIngreseRutGarante1Layout);
        pnlIngreseRutGarante1Layout.setHorizontalGroup(
            pnlIngreseRutGarante1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlIngreseRutGarante1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel31)
                .addGap(18, 18, 18)
                .addGroup(pnlIngreseRutGarante1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtPatenteAprobGtiaAuto)
                    .addComponent(btnBuscarPorPatente, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        pnlIngreseRutGarante1Layout.setVerticalGroup(
            pnlIngreseRutGarante1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlIngreseRutGarante1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlIngreseRutGarante1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(txtPatenteAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscarPorPatente)
                .addContainerGap())
        );

        buttonGroup1.add(chkFolioAprobGtiaAuto);
        chkFolioAprobGtiaAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        chkFolioAprobGtiaAuto.setText("BUSCAR POR N° FOLIO");
        chkFolioAprobGtiaAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkFolioAprobGtiaAutoActionPerformed(evt);
            }
        });

        buttonGroup1.add(chkBuscarPatenteAprobGtiaAuto);
        chkBuscarPatenteAprobGtiaAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        chkBuscarPatenteAprobGtiaAuto.setText("BUSCAR POR PATENTE");
        chkBuscarPatenteAprobGtiaAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkBuscarPatenteAprobGtiaAutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlDatosPersoGara, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnMenuAprobAuto)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(139, 139, 139)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(pnlIngreseRutGarante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(chkFolioAprobGtiaAuto))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(chkBuscarPatenteAprobGtiaAuto)
                                    .addComponent(pnlIngreseRutGarante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chkBuscarPatenteAprobGtiaAuto)
                    .addComponent(chkFolioAprobGtiaAuto, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlIngreseRutGarante1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlIngreseRutGarante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(pnlDatosPersoGara, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 145, Short.MAX_VALUE)
                .addComponent(btnMenuAprobAuto)
                .addGap(63, 63, 63))
        );

        jTabbedPane1.addTab("INFO. GARANTE", jPanel1);

        jPanel6.setPreferredSize(new java.awt.Dimension(815, 600));

        pnlCreacionGaraAuto.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "CONFIRMACIÓN DATOS GARANTÍA AUTOMOTRIZ", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ADJUNTAR ARCHIVO", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        lblArchivo.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblArchivo.setText("VER");

        btnExaminarAprobGtiaAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnExaminarAprobGtiaAuto.setText("VER ARCHIVO");
        btnExaminarAprobGtiaAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExaminarAprobGtiaAutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGap(67, 67, 67)
                .addComponent(lblArchivo)
                .addGap(18, 18, 18)
                .addComponent(btnExaminarAprobGtiaAuto)
                .addContainerGap(81, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblArchivo)
                    .addComponent(btnExaminarAprobGtiaAuto))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        lblSucursal.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblSucursal.setText("SUCURSAL");

        lblDireccion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblDireccion.setText("DIRECCIÓN (CRÉDITO)");

        lblMarca.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblMarca.setText("MARCA");

        lblPatente.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblPatente.setText("PATENTE");

        lblNumChasis.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblNumChasis.setText("N° CHASIS");

        FechCreacion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        FechCreacion.setText("FECHA CREACIÓN");

        FechUltDebito.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        FechUltDebito.setText("FECHA ÚLT. DEBITO");

        txtDireccionAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtDireccionAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtDireccionAprobAuto.setEnabled(false);

        txtNumChasisAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtNumChasisAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtNumChasisAprobAuto.setEnabled(false);

        txtPatenteAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtPatenteAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtPatenteAprobAuto.setEnabled(false);

        lblFechModifica.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblFechModifica.setText("FECHA MODIFICA.");

        lblFechUltTasacion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblFechUltTasacion.setText("FECHA ÚLT. TASACIÓN");

        lblNumMotor.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblNumMotor.setText("N° MOTOR");

        txtNumMotorAprobGtiaAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtNumMotorAprobGtiaAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtNumMotorAprobGtiaAuto.setEnabled(false);

        txtAnoAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtAnoAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtAnoAprobAuto.setEnabled(false);

        lblAño.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblAño.setText("AÑO");

        lblMoneda.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblMoneda.setText("MONEDA");

        txtSucAprobGtiaAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtSucAprobGtiaAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtSucAprobGtiaAuto.setEnabled(false);

        txtMarcaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtMarcaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtMarcaAprobAuto.setEnabled(false);

        txtFechCreaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechCreaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechCreaAprobAuto.setEnabled(false);

        txtFechUltAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechUltAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechUltAprobAuto.setEnabled(false);

        txtMonedaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtMonedaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtMonedaAprobAuto.setEnabled(false);

        txtFechUltTasacAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechUltTasacAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechUltTasacAprobAuto.setEnabled(false);

        txtFechModificaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechModificaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechModificaAprobAuto.setEnabled(false);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDireccion)
                    .addComponent(FechUltDebito)
                    .addComponent(FechCreacion)
                    .addComponent(lblNumChasis)
                    .addComponent(lblPatente)
                    .addComponent(lblMarca)
                    .addComponent(lblSucursal)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblFechUltTasacion)
                            .addComponent(lblFechModifica)
                            .addComponent(lblMoneda)
                            .addComponent(lblAño)
                            .addComponent(lblNumMotor))))
                .addGap(18, 18, 18)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtPatenteAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNumChasisAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDireccionAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtSucAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMarcaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(txtFechCreaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtFechUltAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtMonedaAprobAuto, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtNumMotorAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtAnoAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtFechUltTasacAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtFechModificaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblSucursal)
                    .addComponent(txtSucAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDireccion)
                    .addComponent(txtDireccionAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblMarca)
                    .addComponent(txtMarcaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPatente)
                    .addComponent(txtPatenteAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNumChasis)
                    .addComponent(txtNumChasisAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(FechCreacion)
                    .addComponent(txtFechCreaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(FechUltDebito)
                    .addComponent(txtFechUltAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblMoneda)
                    .addComponent(txtMonedaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAño)
                    .addComponent(txtAnoAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNumMotor)
                    .addComponent(txtNumMotorAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblFechUltTasacion)
                    .addComponent(txtFechUltTasacAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblFechModifica)
                    .addComponent(txtFechModificaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        lblTipoGarantia.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblTipoGarantia.setText("TIPO GARANTÍA");

        lblModelo.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblModelo.setText("MODELO");

        lblNumRegPrenda.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblNumRegPrenda.setText("N° REG. PRENDA");

        lblFechExtincion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblFechExtincion.setText("FECHA EXTINCIÓN");

        lblFechUltRevaluo.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblFechUltRevaluo.setText("FECHA ÚLT. REVALUO");

        FechUltCredito.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        FechUltCredito.setText("FECHA ÚLT. CREDITO");

        txtNumRegPrendaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtNumRegPrendaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtNumRegPrendaAprobAuto.setEnabled(false);

        txtTipoGtiaAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtTipoGtiaAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtTipoGtiaAprobAuto.setEnabled(false);

        txtModeloAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtModeloAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtModeloAprobAuto.setEnabled(false);

        txtFechExtAprobGtiaAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechExtAprobGtiaAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechExtAprobGtiaAuto.setEnabled(false);

        txtFechUltRevAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechUltRevAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechUltRevAprobAuto.setEnabled(false);

        txtFechUltCredAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtFechUltCredAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtFechUltCredAprobAuto.setEnabled(false);

        FechUltCredito1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        FechUltCredito1.setText("MONTO INICIAL");

        txtMontoInicialAutomotriz.setBackground(new java.awt.Color(255, 255, 102));
        txtMontoInicialAutomotriz.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtMontoInicialAutomotriz.setEnabled(false);

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblFechUltRevaluo)
                    .addComponent(FechUltCredito)
                    .addComponent(lblFechExtincion)
                    .addComponent(lblModelo)
                    .addComponent(lblTipoGarantia)
                    .addComponent(lblNumRegPrenda)
                    .addComponent(FechUltCredito1))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtNumRegPrendaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTipoGtiaAprobAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                    .addComponent(txtModeloAprobAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                    .addComponent(txtFechExtAprobGtiaAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                    .addComponent(txtFechUltRevAprobAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                    .addComponent(txtFechUltCredAprobAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                    .addComponent(txtMontoInicialAutomotriz, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTipoGarantia)
                    .addComponent(txtTipoGtiaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblModelo)
                    .addComponent(txtModeloAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNumRegPrenda)
                    .addComponent(txtNumRegPrendaAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblFechExtincion)
                    .addComponent(txtFechExtAprobGtiaAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblFechUltRevaluo)
                    .addComponent(txtFechUltRevAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(FechUltCredito)
                    .addComponent(txtFechUltCredAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(FechUltCredito1)
                    .addComponent(txtMontoInicialAutomotriz, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlCreacionGaraAutoLayout = new javax.swing.GroupLayout(pnlCreacionGaraAuto);
        pnlCreacionGaraAuto.setLayout(pnlCreacionGaraAutoLayout);
        pnlCreacionGaraAutoLayout.setHorizontalGroup(
            pnlCreacionGaraAutoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCreacionGaraAutoLayout.createSequentialGroup()
                .addContainerGap(443, Short.MAX_VALUE)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(pnlCreacionGaraAutoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(pnlCreacionGaraAutoLayout.createSequentialGroup()
                    .addGap(5, 5, 5)
                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 109, Short.MAX_VALUE)
                    .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(5, 5, 5)))
        );
        pnlCreacionGaraAutoLayout.setVerticalGroup(
            pnlCreacionGaraAutoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCreacionGaraAutoLayout.createSequentialGroup()
                .addGap(204, 204, 204)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 65, Short.MAX_VALUE))
            .addGroup(pnlCreacionGaraAutoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(pnlCreacionGaraAutoLayout.createSequentialGroup()
                    .addGap(2, 2, 2)
                    .addGroup(pnlCreacionGaraAutoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(13, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlCreacionGaraAuto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlCreacionGaraAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(94, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 801, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGap(0, 3, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 795, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 3, Short.MAX_VALUE)))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 484, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGap(0, 9, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 8, Short.MAX_VALUE)))
        );

        jTabbedPane1.addTab("INFORMACIÓN GARANTÍA", jPanel3);

        pnlDescripGarantia.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DESCRIPCIÓN GARANTIA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        txtDescripcionAprobAuto.setBackground(new java.awt.Color(255, 255, 102));
        txtDescripcionAprobAuto.setColumns(20);
        txtDescripcionAprobAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        txtDescripcionAprobAuto.setRows(5);
        txtDescripcionAprobAuto.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtDescripcionAprobAuto.setEnabled(false);
        jScrollPane4.setViewportView(txtDescripcionAprobAuto);

        lblDescripcion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblDescripcion.setText("DESCRIPCIÓN");

        javax.swing.GroupLayout pnlDescripGarantiaLayout = new javax.swing.GroupLayout(pnlDescripGarantia);
        pnlDescripGarantia.setLayout(pnlDescripGarantiaLayout);
        pnlDescripGarantiaLayout.setHorizontalGroup(
            pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDescripGarantiaLayout.createSequentialGroup()
                .addGap(70, 70, 70)
                .addComponent(lblDescripcion)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 582, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlDescripGarantiaLayout.setVerticalGroup(
            pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDescripGarantiaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDescripcion)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(367, 367, 367))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDescripGarantia, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDescripGarantia, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(97, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 801, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(0, 5, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 5, Short.MAX_VALUE)))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 484, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(0, 9, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 8, Short.MAX_VALUE)))
        );

        jTabbedPane1.addTab("DESCRIP. GARANTÍA", jPanel2);

        btnMenuPAprobAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnMenuPAprobAuto.setText("MENÚ PRINCIPAL >>");
        btnMenuPAprobAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMenuPAprobAutoActionPerformed(evt);
            }
        });

        btnAceptar.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnAceptar.setText("ACEPTAR");
        btnAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarActionPerformed(evt);
            }
        });

        pnlEstadoGarantia1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ESTADO GARANTIA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        lblEstrado1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblEstrado1.setText("ESTADO");

        cmbEstadoAprobAuto.setEditable(true);
        cmbEstadoAprobAuto.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione" }));

        javax.swing.GroupLayout pnlEstadoGarantia1Layout = new javax.swing.GroupLayout(pnlEstadoGarantia1);
        pnlEstadoGarantia1.setLayout(pnlEstadoGarantia1Layout);
        pnlEstadoGarantia1Layout.setHorizontalGroup(
            pnlEstadoGarantia1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEstadoGarantia1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lblEstrado1)
                .addGap(80, 80, 80)
                .addComponent(cmbEstadoAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(364, 364, 364))
        );
        pnlEstadoGarantia1Layout.setVerticalGroup(
            pnlEstadoGarantia1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlEstadoGarantia1Layout.createSequentialGroup()
                .addContainerGap(27, Short.MAX_VALUE)
                .addGroup(pnlEstadoGarantia1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEstrado1)
                    .addComponent(cmbEstadoAprobAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(78, 78, 78))
        );

        pnlDescripGarantia2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DESCRIPCIÓN GARANTIA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        txtDescripcionEstadoGtia.setColumns(20);
        txtDescripcionEstadoGtia.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        txtDescripcionEstadoGtia.setRows(5);
        txtDescripcionEstadoGtia.setToolTipText("");
        jScrollPane6.setViewportView(txtDescripcionEstadoGtia);

        lblDescripcion2.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblDescripcion2.setText("COMENTARIO");

        javax.swing.GroupLayout pnlDescripGarantia2Layout = new javax.swing.GroupLayout(pnlDescripGarantia2);
        pnlDescripGarantia2.setLayout(pnlDescripGarantia2Layout);
        pnlDescripGarantia2Layout.setHorizontalGroup(
            pnlDescripGarantia2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDescripGarantia2Layout.createSequentialGroup()
                .addContainerGap(46, Short.MAX_VALUE)
                .addComponent(lblDescripcion2)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 614, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pnlDescripGarantia2Layout.setVerticalGroup(
            pnlDescripGarantia2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDescripGarantia2Layout.createSequentialGroup()
                .addContainerGap(28, Short.MAX_VALUE)
                .addGroup(pnlDescripGarantia2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDescripcion2)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(343, 343, 343)
                        .addComponent(btnAceptar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnMenuPAprobAuto))
                    .addComponent(pnlEstadoGarantia1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlDescripGarantia2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlEstadoGarantia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(pnlDescripGarantia2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(61, 61, 61)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnAceptar)
                    .addComponent(btnMenuPAprobAuto))
                .addContainerGap(80, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 801, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 484, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("SÍ/NO", jPanel4);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESAR PATENTE", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarPatenteImprimir.setText("BUSCAR");
        btnBuscarPatenteImprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarPatenteImprimirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(txtBuscarPatenteImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnBuscarPatenteImprimir)
                .addGap(49, 49, 49))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtBuscarPatenteImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnBuscarPatenteImprimir)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        btnImprimirAutomotriz.setText("IMPRIMIR");
        btnImprimirAutomotriz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirAutomotrizActionPerformed(evt);
            }
        });

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ÁREA DE IMPRESIÓN", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        tbSalidarAutomotrizImprimir.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tbSalidarAutomotrizImprimir.setEnabled(false);
        tbSalidarAutomotrizImprimir.setRowHeight(20);
        jScrollPane1.setViewportView(tbSalidarAutomotrizImprimir);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 671, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                .addContainerGap())
        );

        btnMenuPrincipalAutoMotriz.setText("MENÚ PRINCIPAL");
        btnMenuPrincipalAutoMotriz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMenuPrincipalAutoMotrizActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(282, 282, 282)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addContainerGap(39, Short.MAX_VALUE)
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(39, Short.MAX_VALUE))
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnImprimirAutomotriz)
                .addGap(177, 177, 177)
                .addComponent(btnMenuPrincipalAutoMotriz)
                .addGap(68, 68, 68))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnMenuPrincipalAutoMotriz)
                    .addComponent(btnImprimirAutomotriz))
                .addGap(46, 46, 46))
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("IMPRIMIR", jPanel7);

        btnExpAprobGtiaAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnExpAprobGtiaAuto.setText("EXPORTAR A EXCEL");
        btnExpAprobGtiaAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExpAprobGtiaAutoActionPerformed(evt);
            }
        });

        jLabel3.setText("MENÚ PRINCIPAL\\APROBACIÓN GARANTÍA AUTOMOTRIZ");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(114, 114, 114)
                                .addComponent(jLabel1)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnExpAprobGtiaAuto)))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
            .addComponent(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(8, 8, 8)
                        .addComponent(btnExpAprobGtiaAuto))
                    .addComponent(jLabel2)
                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 514, Short.MAX_VALUE)
                .addContainerGap())
        );

        setSize(new java.awt.Dimension(822, 660));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void btnExaminarAprobGtiaAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExaminarAprobGtiaAutoActionPerformed
         String archivo = aproGaraAuto.getAdjuntar_auto();
           if(!archivo.equals("")){  
         File file = new File(archivo);
        try {
            Desktop.getDesktop().open(file);
        } catch (IOException ex) {
            javax.swing.JOptionPane.showMessageDialog(this, "Problema al abrir archivo");
        }
           }else{
           javax.swing.JOptionPane.showMessageDialog(this, "No tiene archivo adjunto");
           } 
    }//GEN-LAST:event_btnExaminarAprobGtiaAutoActionPerformed

    private void btnMenuAprobAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMenuAprobAutoActionPerformed
        MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
        venMenuPrincipal.setVisible(true);
        AprobacionGarantiaAutomotriz.this.dispose();
    }//GEN-LAST:event_btnMenuAprobAutoActionPerformed

    private void btnBuscarPorFolioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPorFolioActionPerformed
        this.txtPatenteAprobGtiaAuto.setText("");
       
       if (!this.txtFolioAprobGtiaAuto.getText().matches("[ 0-9]*")) // expresiones regulares para validar
        {
            javax.swing.JOptionPane.showMessageDialog(this, "Ingrese solo números");
            this.txtFolioAprobGtiaAuto.setText("");
        }
       else{
           
        
        int folio=Integer.parseInt(this.txtFolioAprobGtiaAuto.getText().trim());
        aproGaraAuto = reg.buscarPorFolioAuto(folio);
        
        if(aproGaraAuto.getFolio_garantia_auto() == 0)
        {
            javax.swing.JOptionPane.showMessageDialog(this, "Garantia no Encontrada");
            txtFolioAprobGtiaAuto.setText("");
            limpiar();
            this.btnAceptar.setVisible(false);
        }
        else
        {
            
                this.txtRutGarAprobAuto.setText(aproGaraAuto.getRut_gara_auto());
//                this.txtFolioAprobAuto.setText(String.valueOf(aproGaraAuto.getFolio_garantia_auto()));
                this.txtApellPatAprobAuto.setText(aproGaraAuto.getApell_paterno_auto());
                this.txtApellMatAprobAuto.setText(aproGaraAuto.getApell_paterno_auto());
                this.txtNombreAprobAuto.setText(aproGaraAuto.getNombre_auto());
                this.txtSucAprobGtiaAuto.setText(aproGaraAuto.getSucursal_auto());
                this.txtDireccionAprobAuto.setText(aproGaraAuto.getDireccion_auto());
                this.txtMarcaAprobAuto.setText(aproGaraAuto.getMarca_auto());
                this.txtPatenteAprobAuto.setText(aproGaraAuto.getPatente_auto());
                this.txtNumChasisAprobAuto.setText(aproGaraAuto.getNum_chasis_auto());
                String fechaCreacion = new SimpleDateFormat("dd/MM/yyyy").format(aproGaraAuto.getFech_crea_auto().getTime());
                this.txtFechCreaAprobAuto.setText(fechaCreacion);
                this.txtFechUltAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_debito_auto()));
                this.txtMonedaAprobAuto.setText(aproGaraAuto.getMoneda_auto());
                this.txtAnoAprobAuto.setText(String.valueOf(aproGaraAuto.getAño_auto()));
                this.txtNumMotorAprobGtiaAuto.setText(String.valueOf(aproGaraAuto.getNum_motor_auto()));
                this.txtFechUltTasacAprobAuto.setText(String.valueOf(aproGaraAuto.getFecha_ult_tasa_auto()));
                this.txtFechModificaAprobAuto.setText(String.valueOf(aproGaraAuto.getFecha_modifi_auto()));
                this.txtTipoGtiaAprobAuto.setText(aproGaraAuto.getTipo_garantia_auto());
                this.txtModeloAprobAuto.setText(aproGaraAuto.getModelo_auto());
                this.txtNumRegPrendaAprobAuto.setText(String.valueOf(aproGaraAuto.getNum_reg_prenda_auto()));
                String fechaVen = new SimpleDateFormat("dd/MM/yyyy").format(aproGaraAuto.getFech_extincion_auto().getTime());
                this.txtFechExtAprobGtiaAuto.setText(fechaVen);
                this.txtFechUltRevAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_reval_auto()));
                this.txtFechUltCredAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_reval_credito_auto()));
                this.txtDescripcionAprobAuto.setText(aproGaraAuto.getDescrip_auto());
                this.txtMontoInicialAutomotriz.setText(String.valueOf(aproGaraAuto.getMonto_inicial()));
                if(aproGaraAuto.getEstado_auto() == null && aproGaraAuto.getComent_apro_auto() == null){
   
                this.cmbEstadoAprobAuto.enable(true);
                this.cmbEstadoAprobAuto.setSelectedItem("Seleccione");
                this.txtDescripcionEstadoGtia.enable(true);
                this.btnAceptar.setVisible(true);
                javax.swing.JOptionPane.showMessageDialog(this, "Aun no ha sido Aprobado");
                }
                else{
                
                this.txtDescripcionEstadoGtia.setText(aproGaraAuto.getComent_apro_auto().toString());
                this.cmbEstadoAprobAuto.setSelectedItem(aproGaraAuto.getEstado_auto().toString());
                if(aproGaraAuto.getEstado_auto().equals("Rechazada"))
                {
                javax.swing.JOptionPane.showMessageDialog(this, "Garantia Rechazada");               
                }
                else
                {
                javax.swing.JOptionPane.showMessageDialog(this, "Garantia Aprobada");
                }
                this.txtDescripcionEstadoGtia.enable(false);
                this.btnAceptar.setVisible(false);
                }
           
        }
        }
        
    }//GEN-LAST:event_btnBuscarPorFolioActionPerformed

    private void btnBuscarPorPatenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPorPatenteActionPerformed
        this.txtFolioAprobGtiaAuto.setText("");
        aproGaraAuto = reg.buscarPorPatente(this.txtPatenteAprobGtiaAuto.getText().trim());
        if(aproGaraAuto.getFolio_garantia_auto() == 0)
        {
            javax.swing.JOptionPane.showMessageDialog(this, "Garantia no Encontrada");
            txtPatenteAprobGtiaAuto.setText("");
            limpiar();
            this.btnAceptar.setVisible(false);
        }
        else
        {
            
                this.txtRutGarAprobAuto.setText(aproGaraAuto.getRut_gara_auto());
                this.txtApellPatAprobAuto.setText(aproGaraAuto.getApell_paterno_auto());
                this.txtApellMatAprobAuto.setText(aproGaraAuto.getApell_paterno_auto());
                this.txtNombreAprobAuto.setText(aproGaraAuto.getNombre_auto());
                this.txtSucAprobGtiaAuto.setText(aproGaraAuto.getSucursal_auto());
                this.txtDireccionAprobAuto.setText(aproGaraAuto.getDireccion_auto());
                this.txtMarcaAprobAuto.setText(aproGaraAuto.getMarca_auto());
                this.txtPatenteAprobAuto.setText(aproGaraAuto.getPatente_auto());
                this.txtNumChasisAprobAuto.setText(aproGaraAuto.getNum_chasis_auto());
                String fechaCreacion = new SimpleDateFormat("dd/MM/yyyy").format(aproGaraAuto.getFech_crea_auto().getTime());
                this.txtFechCreaAprobAuto.setText(fechaCreacion);
                this.txtFechUltAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_debito_auto()));
                this.txtMonedaAprobAuto.setText(aproGaraAuto.getMoneda_auto());
                this.txtAnoAprobAuto.setText(String.valueOf(aproGaraAuto.getAño_auto()));
                this.txtNumMotorAprobGtiaAuto.setText(String.valueOf(aproGaraAuto.getNum_motor_auto()));
                this.txtFechUltTasacAprobAuto.setText(String.valueOf(aproGaraAuto.getFecha_ult_tasa_auto()));
                this.txtFechModificaAprobAuto.setText(String.valueOf(aproGaraAuto.getFecha_modifi_auto()));
                this.txtTipoGtiaAprobAuto.setText(aproGaraAuto.getTipo_garantia_auto());
                this.txtModeloAprobAuto.setText(aproGaraAuto.getModelo_auto());
                this.txtNumRegPrendaAprobAuto.setText(String.valueOf(aproGaraAuto.getNum_reg_prenda_auto()));
                String fechaVen = new SimpleDateFormat("dd/MM/yyyy").format(aproGaraAuto.getFech_extincion_auto().getTime());
                this.txtFechExtAprobGtiaAuto.setText(fechaVen);
                this.txtFechUltRevAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_reval_auto()));
                this.txtFechUltCredAprobAuto.setText(String.valueOf(aproGaraAuto.getFech_ult_reval_credito_auto()));
                this.txtDescripcionAprobAuto.setText(aproGaraAuto.getDescrip_auto());
                this.txtMontoInicialAutomotriz.setText(String.valueOf(aproGaraAuto.getMonto_inicial()));
                 if(aproGaraAuto.getEstado_auto() == null && aproGaraAuto.getComent_apro_auto() == null){
 
                this.cmbEstadoAprobAuto.enable(true);
                this.cmbEstadoAprobAuto.setSelectedItem("Seleccione");
                this.txtDescripcionEstadoGtia.enable(true);
                this.btnAceptar.setVisible(true);
                javax.swing.JOptionPane.showMessageDialog(this, "Aun no ha sido Aprobado");
                }
                else{
                
                this.txtDescripcionEstadoGtia.setText(aproGaraAuto.getComent_apro_auto().toString());
                this.cmbEstadoAprobAuto.setSelectedItem(aproGaraAuto.getEstado_auto().toString());
                if(aproGaraAuto.getEstado_auto().equals("Rechazada"))
            {
                javax.swing.JOptionPane.showMessageDialog(this, "Garantia Rechazada");
                
            }
            else{
            javax.swing.JOptionPane.showMessageDialog(this, "Garantia Aprobada");
            }
            this.txtDescripcionEstadoGtia.enable(false);
            this.btnAceptar.setVisible(false);
                 }
        }
    }//GEN-LAST:event_btnBuscarPorPatenteActionPerformed

    private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarActionPerformed
        aproGaraAuto.setEstado_auto(this.cmbEstadoAprobAuto.getSelectedItem().toString());
        aproGaraAuto.setComent_apro_auto(this.txtDescripcionEstadoGtia.getText().trim());
        int respuesta =5;
        if(aproGaraAuto.getEstado_auto().equals("Aprobada"))
        {
            respuesta = javax.swing.JOptionPane.showConfirmDialog(null, "Esta seguro de aprobar esta garantia?", "Aprobacion", JOptionPane.OK_CANCEL_OPTION);
        }
        if(aproGaraAuto.getEstado_auto().equals("Rechazada"))
        {
            respuesta = javax.swing.JOptionPane.showConfirmDialog(null, "Esta seguro de rechazar esta garantia?", "Rechazo", JOptionPane.OK_CANCEL_OPTION);
        }
                
        if(respuesta == 0)
        {
            reg.estadoGarantiaAutomotrizPorFolio(aproGaraAuto, user);
            javax.swing.JOptionPane.showMessageDialog(this, "Aprobacion realizada correctamente ");
            MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
            venMenuPrincipal.setVisible(true);
            AprobacionGarantiaAutomotriz.this.dispose();
        }
       
    
    }//GEN-LAST:event_btnAceptarActionPerformed

    private void chkFolioAprobGtiaAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkFolioAprobGtiaAutoActionPerformed
        if(this.chkFolioAprobGtiaAuto.isSelected())
        {
            pnlIngreseRutGarante.setVisible(true);
            pnlIngreseRutGarante1.setVisible(false);
        }else{
            pnlIngreseRutGarante.setVisible(false);
        }
    }//GEN-LAST:event_chkFolioAprobGtiaAutoActionPerformed

    private void chkBuscarPatenteAprobGtiaAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkBuscarPatenteAprobGtiaAutoActionPerformed
        if(this.chkBuscarPatenteAprobGtiaAuto.isSelected())
        {
            pnlIngreseRutGarante1.setVisible(true);
            pnlIngreseRutGarante.setVisible(false);
        }else{
            pnlIngreseRutGarante1.setVisible(false);
        }
    }//GEN-LAST:event_chkBuscarPatenteAprobGtiaAutoActionPerformed

    private void btnMenuPAprobAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMenuPAprobAutoActionPerformed
        MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
        venMenuPrincipal.setVisible(true);
        AprobacionGarantiaAutomotriz.this.dispose();
    }//GEN-LAST:event_btnMenuPAprobAutoActionPerformed

    private void btnExpAprobGtiaAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExpAprobGtiaAutoActionPerformed
        if(!this.txtFolioAprobGtiaAuto.getText().equals("")){
        int folio = Integer.parseInt(this.txtFolioAprobGtiaAuto.getText().trim());
        reg.exportarGarantiaAutomotrizFolio(folio);
        javax.swing.JOptionPane.showMessageDialog(this, "Exportación realizada con exito");
        File file = new File("C:/export_aprobacion_garantia_Automotriz.csv");
        try {
            Desktop.getDesktop().open(file);
        } catch (IOException ex) {
            Logger.getLogger(IngresoGarante.class.getName()).log(Level.SEVERE, null, ex);
        }
        }
        if(!this.txtPatenteAprobGtiaAuto.getText().equals("")){
        String patente = this.txtPatenteAprobGtiaAuto.getText().trim();
        reg.exportarGarantiaAutomotrizPatente(patente);
        javax.swing.JOptionPane.showMessageDialog(this, "Exportación realizada con exito");
        File file = new File("C:/export_aprobacion_garantia_Automotriz.csv");
        try {
            Desktop.getDesktop().open(file);
        } catch (IOException ex) {
            Logger.getLogger(IngresoGarante.class.getName()).log(Level.SEVERE, null, ex);
        }
        }
    }//GEN-LAST:event_btnExpAprobGtiaAutoActionPerformed

    private void txtFolioAprobGtiaAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFolioAprobGtiaAutoActionPerformed
         if (!this.txtFolioAprobGtiaAuto.getText().matches("[ 0-9]*")) // expresiones regulares para validar
        {
            javax.swing.JOptionPane.showMessageDialog(this, "Ingrese solo números");
            this.txtFolioAprobGtiaAuto.setText("");
        }
    }//GEN-LAST:event_txtFolioAprobGtiaAutoActionPerformed

    private void btnBuscarPatenteImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPatenteImprimirActionPerformed
         try
         {
             ArrayList<garantiaAutomotrizDTO> salida = reg.ListarPorPatenteAuto(this.txtBuscarPatenteImprimir.getText().trim());
             if(salida.isEmpty())
             {
                
                 this.txtBuscarPatenteImprimir.setText(null);
                 DefaultTableModel model = (DefaultTableModel)this.tbSalidarAutomotrizImprimir.getModel();
                 model.setNumRows(0);
                 javax.swing.JOptionPane.showMessageDialog(this, "No hay garantias registradas!");
             }else
             {
                 
                 DefaultTableModel model = (DefaultTableModel)this.tbSalidarAutomotrizImprimir.getModel();
                 model.setColumnCount(0);
                 
                 if(model.getColumnCount() < 1)
                {
                    
                    Object[] arr1 ={"Rut: ","Nombre: ", "Calle: ", "Garantía: ", "Número identificatorio Automotriz: ",
                        "Número de folio: ", "Monto incial: ", "Creación de la garantía: ", "Sucursal:  ",
                        "Dirección (Crédito): ","Marca: ","Número de Chasis: ","Fecha ultimo debito",
                        "Moneda: ","Año: ","Número de Motor: ","Fecha última Tasación: ","Tipo garantía: ",
                        "Modelo: ","Número Regsitro de Prenda: ","Fecha vencimiento: ","Fecha último revaluo: ",
                        "Fecha último crédito: ","Estado de la garantía: ","Fecha Aprobado/Rechazo: ","Usuario: " };
                    model.addColumn("Concepto", arr1);
                    
                    for(garantiaAutomotrizDTO a: salida)
                {
                    Object[] arr2 ={
                         a.getRut_gara_auto(),
                         a.getNombre_auto() + "  " + a.getApell_paterno_auto() + "  " + a.getApell_materno_auto(),
                         a.getCalle_auto() + "  " + a.getNum_auto(),
                         a.getNombre_garantia_auto(),
                         a.getPatente_auto(),
                         a.getFolio_garantia_auto(),
                         a.getMonto_inicial(),
                         a.getFech_crea_auto(),
                         a.getSucursal_auto(),
                         a.getDireccion_auto(),a.getMarca_auto(),a.getNum_chasis_auto(),a.getFech_ult_debito_auto(),
                         a.getMoneda_auto(),a.getAño_auto(),a.getNum_motor_auto(),a.getFecha_ult_tasa_auto(),
                         a.getTipo_garantia_auto(),a.getModelo_auto(),a.getNum_reg_prenda_auto(),a.getFech_extincion_auto(),
                         a.getFech_ult_reval_auto(),a.getFech_ult_reval_credito_auto(),
                         a.getEstado_auto(),
                         a.getFech_crea_auto(),
                         a.getNombre_usuario()
                    };
                     
                    model.addColumn("Contenido",arr2);    
                }
                    
                    Object[] arr3 = {" "," "," "," "," "," "," "," "," "," ",
                                     " "," "," "," "," "," "," "," "," "," ",
                                     " "," "," "," "," "," "};
                    model.addColumn("Observaciones",arr3);
                    
                }

             }
         }
         catch(Exception e)
         {
             e.getMessage();
         }
    }//GEN-LAST:event_btnBuscarPatenteImprimirActionPerformed

    private void btnImprimirAutomotrizActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirAutomotrizActionPerformed
         try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ComprobanteGeneralDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidarAutomotrizImprimir.getRowCount(); fila++)
        {
            
           tipo = new ComprobanteGeneralDTO(String.valueOf(tbSalidarAutomotrizImprimir.getValueAt(fila, 0)),
                    " " + String.valueOf(tbSalidarAutomotrizImprimir.getValueAt(fila, 1)), " " + String.valueOf(tbSalidarAutomotrizImprimir.getValueAt(fila, 2))  + "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ComprobanteGeneralGarantias.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            map.put("subtitulo", "Comprobante Aprobación Automotriz");
            map.put("timbre", "Timbre");
            map.put("fechaUsuario","Fecha");
            map.put("firma","Firma");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(AprobacionGarantiaAutomotriz.class.getName()).log(Level.SEVERE, null, e);
        }
    }//GEN-LAST:event_btnImprimirAutomotrizActionPerformed

    private void btnMenuPrincipalAutoMotrizActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMenuPrincipalAutoMotrizActionPerformed
       MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
       venMenuPrincipal.setVisible(true);
       AprobacionGarantiaAutomotriz.this.dispose();
    }//GEN-LAST:event_btnMenuPrincipalAutoMotrizActionPerformed
    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /*
//         * Set the Nimbus look and feel
//         */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /*
//         * If Nimbus (introduced in Java SE 6) is not available, stay with the
//         * default look and feel. For details see
//         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(AprobacionGarantiaAutomotriz.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(AprobacionGarantiaAutomotriz.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(AprobacionGarantiaAutomotriz.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(AprobacionGarantiaAutomotriz.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /*
//         * Create and display the form
//         */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new AprobacionGarantiaAutomotriz().setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel FechCreacion;
    private javax.swing.JLabel FechUltCredito;
    private javax.swing.JLabel FechUltCredito1;
    private javax.swing.JLabel FechUltDebito;
    private javax.swing.JButton btnAceptar;
    private javax.swing.JButton btnBuscarPatenteImprimir;
    private javax.swing.JButton btnBuscarPorFolio;
    private javax.swing.JButton btnBuscarPorPatente;
    private javax.swing.JButton btnExaminarAprobGtiaAuto;
    private javax.swing.JButton btnExpAprobGtiaAuto;
    private javax.swing.JButton btnImprimirAutomotriz;
    private javax.swing.JButton btnMenuAprobAuto;
    private javax.swing.JButton btnMenuPAprobAuto;
    private javax.swing.JButton btnMenuPrincipalAutoMotriz;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JCheckBox chkBuscarPatenteAprobGtiaAuto;
    private javax.swing.JCheckBox chkFolioAprobGtiaAuto;
    private javax.swing.JComboBox cmbEstadoAprobAuto;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblArchivo;
    private javax.swing.JLabel lblAño;
    private javax.swing.JLabel lblDescripcion;
    private javax.swing.JLabel lblDescripcion2;
    private javax.swing.JLabel lblDireccion;
    private javax.swing.JLabel lblEstrado1;
    private javax.swing.JLabel lblFechExtincion;
    private javax.swing.JLabel lblFechModifica;
    private javax.swing.JLabel lblFechUltRevaluo;
    private javax.swing.JLabel lblFechUltTasacion;
    private javax.swing.JLabel lblMarca;
    private javax.swing.JLabel lblModelo;
    private javax.swing.JLabel lblMoneda;
    private javax.swing.JLabel lblNumChasis;
    private javax.swing.JLabel lblNumMotor;
    private javax.swing.JLabel lblNumRegPrenda;
    private javax.swing.JLabel lblPatente;
    private javax.swing.JLabel lblSucursal;
    private javax.swing.JLabel lblTipoGarantia;
    private javax.swing.JPanel pnlCreacionGaraAuto;
    private javax.swing.JPanel pnlDatosPersoGara;
    private javax.swing.JPanel pnlDescripGarantia;
    private javax.swing.JPanel pnlDescripGarantia2;
    private javax.swing.JPanel pnlEstadoGarantia1;
    private javax.swing.JPanel pnlIngreseRutGarante;
    private javax.swing.JPanel pnlIngreseRutGarante1;
    private javax.swing.JTable tbSalidarAutomotrizImprimir;
    private javax.swing.JTextField txtAnoAprobAuto;
    private javax.swing.JTextField txtApellMatAprobAuto;
    private javax.swing.JTextField txtApellPatAprobAuto;
    private javax.swing.JTextField txtBuscarPatenteImprimir;
    private javax.swing.JTextArea txtDescripcionAprobAuto;
    private javax.swing.JTextArea txtDescripcionEstadoGtia;
    private javax.swing.JTextField txtDireccionAprobAuto;
    private javax.swing.JTextField txtFechCreaAprobAuto;
    private javax.swing.JTextField txtFechExtAprobGtiaAuto;
    private javax.swing.JTextField txtFechModificaAprobAuto;
    private javax.swing.JTextField txtFechUltAprobAuto;
    private javax.swing.JTextField txtFechUltCredAprobAuto;
    private javax.swing.JTextField txtFechUltRevAprobAuto;
    private javax.swing.JTextField txtFechUltTasacAprobAuto;
    private javax.swing.JTextField txtFolioAprobGtiaAuto;
    private javax.swing.JTextField txtMarcaAprobAuto;
    private javax.swing.JTextField txtModeloAprobAuto;
    private javax.swing.JTextField txtMonedaAprobAuto;
    private javax.swing.JTextField txtMontoInicialAutomotriz;
    private javax.swing.JTextField txtNombreAprobAuto;
    private javax.swing.JTextField txtNumChasisAprobAuto;
    private javax.swing.JTextField txtNumMotorAprobGtiaAuto;
    private javax.swing.JTextField txtNumRegPrendaAprobAuto;
    private javax.swing.JTextField txtPatenteAprobAuto;
    private javax.swing.JTextField txtPatenteAprobGtiaAuto;
    private javax.swing.JTextField txtRutGarAprobAuto;
    private javax.swing.JTextField txtSucAprobGtiaAuto;
    private javax.swing.JTextField txtTipoGtiaAprobAuto;
    // End of variables declaration//GEN-END:variables

    
    private void limpiar() {
        
                this.txtRutGarAprobAuto.setText(null);
//                this.txtFolioAprobAuto.setText(null);
                this.txtApellPatAprobAuto.setText(null);
                this.txtApellMatAprobAuto.setText(null);
                this.txtNombreAprobAuto.setText(null);
                this.txtSucAprobGtiaAuto.setText(null);
                this.txtDireccionAprobAuto.setText(null);
                this.txtMarcaAprobAuto.setText(null);
                this.txtPatenteAprobAuto.setText(null);
                this.txtNumChasisAprobAuto.setText(null);
                this.txtFechCreaAprobAuto.setText(null);
                this.txtFechUltAprobAuto.setText(null);
                this.txtMonedaAprobAuto.setText(null);
                this.txtAnoAprobAuto.setText(null);
                this.txtNumMotorAprobGtiaAuto.setText(null);
                this.txtFechUltTasacAprobAuto.setText(null);
                this.txtFechModificaAprobAuto.setText(null);
                this.txtTipoGtiaAprobAuto.setText(null);
                this.txtModeloAprobAuto.setText(null);
                this.txtNumRegPrendaAprobAuto.setText(null);
                this.txtFechExtAprobGtiaAuto.setText(null);
                this.txtFechUltRevAprobAuto.setText(null);
                this.txtFechUltCredAprobAuto.setText(null);
                this.txtDescripcionEstadoGtia.setText(null);
                this.cmbEstadoAprobAuto.setSelectedItem("Seleccione");
                this.txtDescripcionAprobAuto.setText(null);
                this.txtMontoInicialAutomotriz.setText(null);
    }
}
